<meta charset="UTF-8">
<?php

require ('./lib/init.php');
$num = 1;
$searchWord = '';
// 判断是否已经登录
if (!acc()) {
    header('Location:login.php');
}
// 查询所有栏目
$sql = "select cat_id,cat_name,cat_num from cat";
$cats = mGetAll($sql);

//判断地址栏是否有cat_id
if (isset($_GET['cat_id'])){
    $where = " and art.cat_id = $_GET[cat_id]" ;
}else{
    $where = "";
}
// 查找文章
$sql = "select art_id,pubtime,title,comm,cat_name from art left join cat on art.cat_id = cat.cat_id where 1 " . $where . ' order by pubtime desc';
$arts = mGetAll($sql);
include (ROOT . '/view/admin/artlist.html');



?>
